<div class = "main-view">

    <div class="left-margin top-margin"><strong class="am-text-primary am-text-lg">话题管理</strong></div>
    <form class="am-form-inline left-margin top-margin" role="form">
        <div class="am-form-group">
            <label>话题标题：</label> <input type="text" class="modal-input" style="height: 30px" ng-model="themeTitle" >
        </div>

        <button type="submit" class="am-btn am-btn-primary" ng-click="search()" data-target = "cascad-search">搜索</button>
    </form>
    <br>
    <div class="am-btn-group am-btn-group-xs left-margin top-margin">
        <button type="button" class="am-btn am-btn-default" data-am-modal="{target: '#doc-modal-add', width: 800, height: 600}"><span class="am-icon-plus"></span>添加话题</button>
        <!--<button type="button" class="am-btn am-btn-default" ng-click="delete()"><span class="am-icon-trash-o"></span> 删除</button>-->
    </div>
    <div id = "pagination" class = "pagination"></div>
    <div class="pagination-table left-margin" id="tab_menu" style = "margin-top: 0px;">
        <form class="am-form">
            <table class="am-table-striped am-table-hover table-main">
                <thead>
                <tr>
                    <th class="table-check"><input type="checkbox" ng-click="allSelected()"></th>
                    <!--<th>序号</th>-->
                    <th>话题标题</th>
                    <th>话题副标题</th>
                    <!--<th>描述</th>-->
                    <th>URL</th>
                    <th>创建日期</th>
                    <th>点击数</th>
                    <th>发帖数/人数</th>
                    <th>回复数/人数</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                <tr ng-repeat="result in resultList"  id = "{{result.objId}}">
                    <td class="table-check"><input type="checkbox" class = "item-check"></td>
                    <!--<td>{{result.id}}</td>-->
                    <td>{{result.title}}</td>
                    <td>{{result.subTitle}}</td>
                    <!--<td>{{result.desc}}</td>-->
                    <td>{{result.url}}</td>
                    <td>{{result.dateCreated|date:"yyyy-MM-dd HH:mm:ss"}}</td>
                    <td>{{result.browserCount}}</td>
                    <td>{{result.questionCount}}/{{result.questionHeadCount}}</td>
                    <td>{{result.replyCount}}/{{result.replyHeadCount}}</td>
                    <td>
                        <div class="am-btn-toolbar">
                            <div class="am-btn-group am-btn-group-xs">
                                <button type="button" class="am-btn am-btn-default am-btn-xs am-text-secondary" ng-click="themeEdit(result)" >编辑</button>
                                <!--<button type="button" class="am-btn am-btn-default am-btn-xs am-hide-sm-only" ng-click="themePushShow(result)" >推送</button>-->
                            </div>
                        </div>
                    </td>
                </tr>
                </tbody>
            </table>
        </form>
    </div>
    <div class = "left-margin">共<span id = 'page_number'>{{pageNumber}}</span>页 <span>{{count}}条数据</span></div>

    <!--新增框 -->
    <div class="am-modal am-modal-no-btn" tabindex="-1" id="doc-modal-add">
        <div class="am-modal-dialog">
            <div class="am-modal-hd border-bottom" style = "text-align: left;">新增话题
                <a href="javascript: void(0)" class="am-close am-close-spin" data-am-modal-close>&times;</a>
            </div>
            <div style="position:absolute; left:10%; right:10%;">
                <div class="am-modal-bd body-area text-left">
                    <form>
                        <br>
                        <label style="width:100px">话题标题:</label><input class="modal-input" style="width:500px" ng-model="addData.title" >
                        <br>
                        <label style="width:100px">话题副标题:</label><input class="modal-input" style="width:500px" ng-model="addData.subTitle" >
                        <br>
                        <div class="form-group">
                            <label class="control-label"  style="width:180px" for="textinput">图片(最多可上传1张):</label>
                            <input type="file" id="images_upload"
                                   onchange="angular.element(this).scope().selectFile(this.files,'add')" multiple accept="image/*">
                            <div id="image_result" class="image-result"></div>
                        </div>
                        <br>
                        <label class="control-label">话题描述:</label><br />
                        <textarea style="width:600px;height:100px;" ng-model="addData.desc" ></textarea>
                        <br>
                        <label style="width:82px">分享描述：</label>
                        <input type="text" class = "modal-input" style = "width: 600px;display: inline-block;" ng-model="addData.shareDesc">
                        <br>
                        <br>
                        <div><label>分享图标</label>
                            <input type="file" id="images_upload_share" onchange="angular.element(this).scope().selectFile(this.files,'add','share')" accept="image/*">
                        </div>

                        <div id="image_share" class="image-result"></div>

                    </form>
                </div>
                <div class = "button-area border-top">
                    <button type="button" class="am-btn am-btn-success right-margin top-margin" ng-show="true" ng-click="addTheme(addData,$event)" data-target = "cascad-search-add">保存</button>
                </div>
            </div>
        </div>
    </div>

    <!--编辑框 -->
    <div class="am-modal am-modal-no-btn" tabindex="-1" id="doc-modal-edit">
        <div class="am-modal-dialog">
            <div class="am-modal-hd border-bottom" style = "text-align: left;">编辑Banner
                <a href="javascript: void(0)" class="am-close am-close-spin" data-am-modal-close>&times;</a>
            </div>
            <div style="position:absolute; left:10%; right:10%;">
                <div class="am-modal-bd body-area text-left">
                    <form>
                        <br>
                        <label style="width:100px">话题标题:</label><input class="modal-input" style="width:500px" ng-model="updataData.title" >
                        <br>
                        <label style="width:100px">话题副标题:</label><input class="modal-input" style="width:500px" ng-model="updataData.subTitle" >
                        <br>
                        <div>
                            <!--<slide>-->
                                <!--<img ng-src="{{updateDate.imageURL}}" style="width: 100px;" onclick="if($(this).width()==100){-->
                                                    <!--$('img').width(100);-->
                                                    <!--$(this).width(360);-->
                                                    <!--}else{-->
                                                    <!--$(this).width(100);-->
                                                    <!--};">-->
                            <!--</slide>-->
                            <slide ng-repeat="img in updataData.images" active="img.active">
                                <img ng-src="{{img.imageURL}}" style="width: 100px;" onclick="if($(this).width()==100){
                                                    $('img').width(100);
                                                    $(this).width(360);
                                                    }else{
                                                    $(this).width(100);
                                                    };">
                            </slide>
                        </div>
                        <br>
                        <div class="form-group">
                            <label class="control-label"  style="width:180px" for="textinput">图片(最多可上传1张):</label>
                            <input type="file" id="images_upload_edit"
                                   onchange="angular.element(this).scope().selectFile(this.files,'edit')" accept="image/*">
                            <div id="image_result_edit" class="image-result"></div>
                        </div>
                        <br>
                        <label class="control-label">话题描述:</label><br />
                        <textarea style="width:600px;height:100px;" ng-model="updataData.desc" ></textarea>

                        <br>
                        <label style="width:82px">分享描述：</label>
                        <input type="text" class = "modal-input" style = "width: 600px;display: inline-block;" ng-model="updataData.shareDesc">
                        <br>
                        <div>
                            <slide>
                                <img ng-src="{{updataData.shareImage}}" style="width: 100px;" onclick="if($(this).width()==100){
                                                    $('img').width(100);
                                                    $(this).width(360);
                                                    }else{
                                                    $(this).width(100);
                                                    };">
                            </slide>
                        </div>
                        <br>
                        <div><label>分享图标</label>
                            <input type="file" id="images_upload_share_edit" onchange="angular.element(this).scope().selectFile(this.files,'edit','share')" accept="image/*">
                        </div>

                        <div id="image_share_edit" class="image-result"></div>

                    </form>
                </div>
                <div class = "button-area border-top">
                    <button type="button" class="am-btn am-btn-success right-margin top-margin" ng-show="true" ng-click="updateTheme(updataData,$event)" data-target = "cascad-edit">保存</button>
                </div>
            </div>
        </div>
    </div>


</div>